﻿namespace Agent
{
    using Agent.Dialogs;
    using System;
    using System.CodeDom.Compiler;
    using System.Collections;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.IO;
    using System.Runtime.CompilerServices;
    using System.Threading;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Markup;
    using System.Windows.Media.Imaging;
    using TheSafety;
    using TheSafety.Dialogs;

    [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
    public class OptionsWindow : Window, IComponentConnector
    {
        private const string a = "Forever";
        internal Label a0;
        internal ComboBox a1;
        internal Label a2;
        internal ComboBox a3;
        internal Label a4;
        internal TabItem a5;
        internal GroupBox a6;
        internal CheckBox a7;
        internal CheckBox a8;
        internal ComboBox a9;
        internal CheckBox aa;
        internal Image ab;
        internal Image ac;
        internal TabItem ad;
        internal GroupBox ae;
        internal CheckBox af;
        internal TabItem ag;
        internal GroupBox ah;
        internal Label ai;
        internal Image aj;
        internal RadioButton ak;
        internal RadioButton al;
        internal RadioButton am;
        internal CheckBox an;
        internal Label ao;
        internal ComboBox ap;
        internal Label aq;
        internal MaskedTextBox ar;
        internal GroupBox @as;
        internal CheckBox at;
        internal CheckBox au;
        internal Label av;
        internal ComboBox aw;
        internal Label ax;
        internal Label ay;
        internal ComboBox az;
        private const string b = "Never";
        internal CheckBox ba;
        internal Button bb;
        internal Button bc;
        private bool bd;
        private const string c = "Immediately";
        private SynchronizationContext d;
        internal Image e;
        internal TabControl f;
        internal TabItem g;
        internal GroupBox h;
        internal TextBox i;
        internal Label j;
        internal PasswordBox k;
        internal Label l;
        internal Image m;
        internal Image n;
        internal Label o;
        internal TextBlock p;
        internal Label q;
        internal GroupBox r;
        internal TextBox s;
        internal Label t;
        internal Image u;
        internal TextBox v;
        internal Label w;
        internal Image x;
        internal GroupBox y;
        internal CheckBox z;

        public OptionsWindow()
        {
            this.InitializeComponent();
            this.c();
        }

        private void a()
        {
            if (AgentUser.a().b() == LicenseType.Limited)
            {
                MessageBox.Show(e.c("AccountChanged"));
                base.Close();
            }
            else if (AgentUser.a().b() == LicenseType.Premium)
            {
                this.q.Visibility = this.p.Visibility = this.q.Visibility = Visibility.Visible;
                this.n.Source = new BitmapImage(new Uri("pack://application:,,,/thesafety;component/resources/license_limited.png"));
            }
            else if (AgentUser.a().b() == LicenseType.Elite)
            {
                this.n.Source = new BitmapImage(new Uri("pack://application:,,,/thesafety;component/resources/license_premium.png"));
            }
            this.n.Visibility = Visibility.Visible;
        }

        [CompilerGenerated]
        private void a(object A_0)
        {
            base.IsEnabled = true;
        }

        [EditorBrowsable(EditorBrowsableState.Never), DebuggerNonUserCode]
        private void a(int A_0, object A_1)
        {
            switch (A_0)
            {
                case 1:
                    ((OptionsWindow) A_1).Loaded += new RoutedEventHandler(this.Window_Loaded);
                    return;

                case 2:
                    this.e = (Image) A_1;
                    return;

                case 3:
                    this.f = (TabControl) A_1;
                    return;

                case 4:
                    this.g = (TabItem) A_1;
                    return;

                case 5:
                    this.h = (GroupBox) A_1;
                    return;

                case 6:
                    this.i = (TextBox) A_1;
                    return;

                case 7:
                    this.j = (Label) A_1;
                    return;

                case 8:
                    this.k = (PasswordBox) A_1;
                    return;

                case 9:
                    this.l = (Label) A_1;
                    return;

                case 10:
                    this.m = (Image) A_1;
                    this.m.MouseLeftButtonUp += new MouseButtonEventHandler(this.EditPassword_Click);
                    return;

                case 11:
                    this.n = (Image) A_1;
                    return;

                case 12:
                    this.o = (Label) A_1;
                    return;

                case 13:
                    this.p = (TextBlock) A_1;
                    return;

                case 14:
                    this.q = (Label) A_1;
                    this.q.MouseLeftButtonUp += new MouseButtonEventHandler(this.lblLicenseDifference_MouseLeftButtonUp);
                    return;

                case 15:
                    this.r = (GroupBox) A_1;
                    return;

                case 0x10:
                    this.s = (TextBox) A_1;
                    return;

                case 0x11:
                    this.t = (Label) A_1;
                    return;

                case 0x12:
                    this.u = (Image) A_1;
                    this.u.MouseLeftButtonUp += new MouseButtonEventHandler(this.editEmail_click);
                    return;

                case 0x13:
                    this.v = (TextBox) A_1;
                    return;

                case 20:
                    this.w = (Label) A_1;
                    return;

                case 0x15:
                    this.x = (Image) A_1;
                    this.x.MouseLeftButtonUp += new MouseButtonEventHandler(this.editIcq_Click);
                    return;

                case 0x16:
                    this.y = (GroupBox) A_1;
                    return;

                case 0x17:
                    this.z = (CheckBox) A_1;
                    return;

                case 0x18:
                    this.aa = (CheckBox) A_1;
                    return;

                case 0x19:
                    this.ab = (Image) A_1;
                    return;

                case 0x1a:
                    this.ac = (Image) A_1;
                    return;

                case 0x1b:
                    this.ad = (TabItem) A_1;
                    return;

                case 0x1c:
                    this.ae = (GroupBox) A_1;
                    return;

                case 0x1d:
                    this.af = (CheckBox) A_1;
                    return;

                case 30:
                    this.ag = (TabItem) A_1;
                    return;

                case 0x1f:
                    this.ah = (GroupBox) A_1;
                    return;

                case 0x20:
                    this.ai = (Label) A_1;
                    return;

                case 0x21:
                    this.aj = (Image) A_1;
                    return;

                case 0x22:
                    this.ak = (RadioButton) A_1;
                    this.ak.Click += new RoutedEventHandler(this.radioNotifier_Click);
                    return;

                case 0x23:
                    this.al = (RadioButton) A_1;
                    this.al.Click += new RoutedEventHandler(this.radioNotifier_Click);
                    return;

                case 0x24:
                    this.am = (RadioButton) A_1;
                    this.am.Click += new RoutedEventHandler(this.radioNotifier_Click);
                    return;

                case 0x25:
                    this.an = (CheckBox) A_1;
                    return;

                case 0x26:
                    this.ao = (Label) A_1;
                    this.ao.MouseLeftButtonUp += new MouseButtonEventHandler(this.lblUpdateNow_MouseLeftButtonUp);
                    return;

                case 0x27:
                    this.ap = (ComboBox) A_1;
                    return;

                case 40:
                    this.aq = (Label) A_1;
                    return;

                case 0x29:
                    this.ar = (MaskedTextBox) A_1;
                    return;

                case 0x2a:
                    this.@as = (GroupBox) A_1;
                    return;

                case 0x2b:
                    this.at = (CheckBox) A_1;
                    this.at.Click += new RoutedEventHandler(this.chkNotifyMe_Click);
                    return;

                case 0x2c:
                    this.au = (CheckBox) A_1;
                    this.au.Click += new RoutedEventHandler(this.chkNotifyMe_Click);
                    return;

                case 0x2d:
                    this.av = (Label) A_1;
                    this.av.MouseLeftButtonUp += new MouseButtonEventHandler(this.lblShowNews_MouseLeftButtonUp);
                    return;

                case 0x2e:
                    this.aw = (ComboBox) A_1;
                    return;

                case 0x2f:
                    this.ax = (Label) A_1;
                    return;

                case 0x30:
                    this.ay = (Label) A_1;
                    return;

                case 0x31:
                    this.az = (ComboBox) A_1;
                    this.az.SelectionChanged += new SelectionChangedEventHandler(this.ddlWithIn_SelectionChanged);
                    return;

                case 50:
                    this.a0 = (Label) A_1;
                    return;

                case 0x33:
                    this.a1 = (ComboBox) A_1;
                    return;

                case 0x34:
                    this.a2 = (Label) A_1;
                    return;

                case 0x35:
                    this.a3 = (ComboBox) A_1;
                    return;

                case 0x36:
                    this.a4 = (Label) A_1;
                    return;

                case 0x37:
                    this.a5 = (TabItem) A_1;
                    return;

                case 0x38:
                    this.a6 = (GroupBox) A_1;
                    return;

                case 0x39:
                    this.a7 = (CheckBox) A_1;
                    return;

                case 0x3a:
                    this.a8 = (CheckBox) A_1;
                    this.a8.Click += new RoutedEventHandler(this.chkAutoConnection_Click);
                    return;

                case 0x3b:
                    this.a9 = (ComboBox) A_1;
                    return;

                case 60:
                    this.ba = (CheckBox) A_1;
                    return;

                case 0x3d:
                    this.bb = (Button) A_1;
                    this.bb.Click += new RoutedEventHandler(this.btnOk_Click);
                    return;

                case 0x3e:
                    this.bc = (Button) A_1;
                    this.bc.Click += new RoutedEventHandler(this.btnCancel_Click);
                    return;
            }
            this.bd = true;
        }

        [DebuggerNonUserCode]
        internal Delegate a(Type A_0, string A_1)
        {
            return Delegate.CreateDelegate(A_0, this, A_1);
        }

        private void b()
        {
            new Thread(new ParameterizedThreadStart(this.e)) { IsBackground = true }.Start(null);
            this.a9.Items.Clear();
            string[] strArray = ConfigManager.c(ConfigManager.q() + "/config");
            if (strArray != null)
            {
                foreach (string str in strArray)
                {
                    try
                    {
                        FileInfo info = new FileInfo(str);
                        info.Name.Substring(0, info.Name.IndexOf("_", 0));
                        string str2 = info.Name.Replace(".ovpn", "");
                        str2 = str2.Substring(str2.IndexOf("_") + 1);
                        int index = str2.IndexOf("_");
                        ComboBoxItem newItem = new ComboBoxItem {
                            Content = str2.Substring(index + 1) + " - " + str2.Substring(0, index),
                            Tag = info.Name
                        };
                        this.a9.Items.Add(newItem);
                    }
                    catch (Exception exception)
                    {
                        ConfigManager.a("LoadSettings", exception);
                    }
                }
                this.a9.SelectedIndex = 0;
            }
        }

        [CompilerGenerated]
        private void b(object A_0)
        {
            base.IsEnabled = false;
        }

        private void btnCancel_Click(object A_0, RoutedEventArgs A_1)
        {
            base.Close();
        }

        private void btnOk_Click(object A_0, RoutedEventArgs A_1)
        {
            if (this.aa.IsChecked.HasValue && this.aa.IsChecked.Value)
            {
                ConfigManager.a("setauto", "1");
            }
            else
            {
                ConfigManager.a("setauto", "0");
            }
            if (this.z.IsChecked.HasValue && this.z.IsChecked.Value)
            {
                ConfigManager.a("p12", "1");
            }
            else
            {
                ConfigManager.a("p12", "0");
            }
            if (this.af.IsChecked.HasValue && this.af.IsChecked.Value)
            {
                ConfigManager.a("netblocker", "1");
            }
            else
            {
                ConfigManager.a("netblocker", "0");
            }
            if (this.an.IsChecked.HasValue && this.an.IsChecked.Value)
            {
                ConfigManager.a("updateifactive", "1");
            }
            else
            {
                ConfigManager.a("updateifactive", "0");
            }
            if (this.ak.IsChecked.HasValue && this.ak.IsChecked.Value)
            {
                ConfigManager.a("schedulerupdate", "0");
            }
            else if (this.al.IsChecked.HasValue && this.al.IsChecked.Value)
            {
                ConfigManager.a("schedulerupdate", "1");
            }
            else
            {
                ConfigManager.a("schedulerupdate", "2");
            }
            ConfigManager.a("updatein", this.ar.Text);
            ConfigManager.a("updateeach", (this.ap.SelectedItem as ComboBoxItem).Tag.ToString());
            ConfigManager.a("notifydaysbefore", (this.aw.SelectedItem as ComboBoxItem).Content.ToString());
            ConfigManager.a("notifydeletedays", (this.a3.SelectedItem as ComboBoxItem).Tag.ToString());
            ConfigManager.a("notifyrepeateeach", (this.a1.SelectedItem as ComboBoxItem).Tag.ToString());
            ConfigManager.a("notifywithin", (this.az.SelectedItem as ComboBoxItem).Tag.ToString());
            if (this.a9.SelectedItem is ComboBoxItem)
            {
                ConfigManager.a("autoconnectconfig", (this.a9.SelectedItem as ComboBoxItem).Tag.ToString());
            }
            if (this.at.IsChecked.HasValue && this.at.IsChecked.Value)
            {
                ConfigManager.a("notifymeprolong", "1");
            }
            else
            {
                ConfigManager.a("notifymeprolong", "0");
            }
            if (this.au.IsChecked.HasValue && this.au.IsChecked.Value)
            {
                ConfigManager.a("notifymeimportant", "1");
            }
            else
            {
                ConfigManager.a("notifymeimportant", "0");
            }
            if (this.a8.IsChecked.HasValue && this.a8.IsChecked.Value)
            {
                ConfigManager.a("autoconnection", "1");
            }
            else
            {
                ConfigManager.a("autoconnection", "0");
            }
            if (this.ba.IsChecked.HasValue && this.ba.IsChecked.Value)
            {
                ConfigManager.a("dontshownotification", "1");
            }
            else
            {
                ConfigManager.a("dontshownotification", "0");
            }
            if (this.a7.IsChecked.HasValue && this.a7.IsChecked.Value)
            {
                if (!ConfigManager.c())
                {
                    ConfigManager.e();
                }
            }
            else if (ConfigManager.c())
            {
                ConfigManager.d();
            }
            if ((AgentUser.a().b() != LicenseType.Limited) && (AgentUser.a() != null))
            {
                NewsManager.d();
            }
            base.Close();
        }

        private void c()
        {
            this.t.Content = e.c("Email") + ":";
            this.w.Content = e.c("Icq") + ":";
            this.j.Content = e.c("Login");
            this.l.Content = e.c("Password");
            this.r.Header = e.c("AccountInformation");
            this.h.Header = e.c("TypeYourLoginAndPasswordForAccount");
            this.y.Header = e.c("AdditionalSettings");
            this.bc.Content = e.c("Cancel");
            this.z.Content = e.c("P12");
            this.aa.Content = e.c("SetAuto");
            this.g.Header = e.c("SettingsTabMain");
            this.ad.Header = e.c("SettingsTabNetBlocker");
            this.ag.Header = e.c("SettingsTabNotifications");
            this.a5.Header = e.c("SettingsTabOther");
            this.ab.ToolTip = e.c("P12ToolTip");
            this.ac.ToolTip = e.c("AutoLoginToolTip");
            this.o.Content = e.c("GUILicense") + ":";
            this.p.Text = e.c("GUILicenseInfo");
            this.af.Content = e.c("UseNetBlocker");
            this.ae.Header = e.c("NetBlockerHeader");
            base.Title = e.c("OptionsWindowTitle");
            this.aj.ToolTip = new TextBlock(new System.Windows.Documents.Run(e.c("SchedulerInfo")));
            (this.aj.ToolTip as TextBlock).Width = 250.0;
            (this.aj.ToolTip as TextBlock).TextWrapping = TextWrapping.Wrap;
            (this.aj.ToolTip as TextBlock).TextAlignment = TextAlignment.Left;
            this.m.ToolTip = new TextBlock(new System.Windows.Documents.Run(e.c("EditPassInfo")));
            (this.m.ToolTip as TextBlock).Width = 200.0;
            (this.m.ToolTip as TextBlock).TextWrapping = TextWrapping.Wrap;
            (this.m.ToolTip as TextBlock).TextAlignment = TextAlignment.Left;
            this.u.ToolTip = new TextBlock(new System.Windows.Documents.Run(e.c("EditEmailInfo")));
            (this.u.ToolTip as TextBlock).Width = 200.0;
            (this.u.ToolTip as TextBlock).TextWrapping = TextWrapping.Wrap;
            (this.u.ToolTip as TextBlock).TextAlignment = TextAlignment.Left;
            this.x.ToolTip = new TextBlock(new System.Windows.Documents.Run(e.c("EditIcqInfo")));
            (this.x.ToolTip as TextBlock).Width = 200.0;
            (this.x.ToolTip as TextBlock).TextWrapping = TextWrapping.Wrap;
            (this.x.ToolTip as TextBlock).TextAlignment = TextAlignment.Left;
            this.al.Content = e.c("UpdateDailyIn");
            this.ak.Content = e.c("UpdateEach");
            this.am.Content = e.c("Never");
            this.an.Content = e.c("UpdateIfConnected");
            this.ai.Content = e.c("SchedulerSettings");
            this.@as.Header = e.c("NotificationsAdditionalSettings");
            this.a7.Content = e.c("LaunchAtWindowsStartup");
            this.aq.Content = e.c("MinHours");
            this.a4.Content = e.c("For");
            this.ax.Content = e.c("DaysBefore");
            this.ay.Content = e.c("ShowWithIn");
            this.a0.Content = e.c("Repeat");
            this.a2.Content = e.c("DeleteNotifications");
            this.at.Content = e.c("NotifyMeProlong");
            this.au.Content = e.c("NotifyMeImportant");
            this.ao.Content = e.c("UpdateNow");
            this.av.Content = e.c("ShowSavedNews");
            this.bb.Content = e.c("Save");
            this.q.Content = e.c("GUILicenseDifference");
            this.a6.Header = e.c("Other");
            this.a8.Content = e.c("AutoConnection");
            this.ba.Content = e.c("DontShowNotification");
            ComboBoxItem newItem = new ComboBoxItem {
                Content = "10 " + e.c("Minutes"),
                Tag = "10"
            };
            this.ap.Items.Add(newItem);
            ComboBoxItem item2 = new ComboBoxItem {
                Content = "30 " + e.c("Minutes"),
                Tag = "30"
            };
            this.ap.Items.Add(item2);
            ComboBoxItem item3 = new ComboBoxItem {
                Content = "60 " + e.c("Minutes"),
                Tag = "60"
            };
            this.ap.Items.Add(item3);
            ComboBoxItem item4 = new ComboBoxItem {
                Content = "6 " + e.c("Hours"),
                Tag = "360"
            };
            this.ap.Items.Add(item4);
            ComboBoxItem item5 = new ComboBoxItem {
                Content = "12 " + e.c("Hours"),
                Tag = "720"
            };
            this.ap.Items.Add(item5);
            ComboBoxItem item6 = new ComboBoxItem {
                Content = "1"
            };
            this.aw.Items.Add(item6);
            ComboBoxItem item7 = new ComboBoxItem {
                Content = "3"
            };
            this.aw.Items.Add(item7);
            ComboBoxItem item8 = new ComboBoxItem {
                Content = "7"
            };
            this.aw.Items.Add(item8);
            ComboBoxItem item9 = new ComboBoxItem {
                Content = "15"
            };
            this.aw.Items.Add(item9);
            ComboBoxItem item10 = new ComboBoxItem {
                Content = "5 " + e.c("Secunds"),
                Tag = "5"
            };
            this.az.Items.Add(item10);
            ComboBoxItem item11 = new ComboBoxItem {
                Content = "10 " + e.c("Secunds"),
                Tag = "10"
            };
            this.az.Items.Add(item11);
            ComboBoxItem item12 = new ComboBoxItem {
                Content = e.c("Forever"),
                Tag = "Forever"
            };
            this.az.Items.Add(item12);
            ComboBoxItem item13 = new ComboBoxItem {
                Content = "2 " + e.c("Minutes"),
                Tag = "2"
            };
            this.a1.Items.Add(item13);
            ComboBoxItem item14 = new ComboBoxItem {
                Content = "5 " + e.c("Minutes"),
                Tag = "5"
            };
            this.a1.Items.Add(item14);
            ComboBoxItem item15 = new ComboBoxItem {
                Content = "10 " + e.c("Minutes"),
                Tag = "10"
            };
            this.a1.Items.Add(item15);
            ComboBoxItem item16 = new ComboBoxItem {
                Content = e.c("Never"),
                Tag = "Never"
            };
            this.a1.Items.Add(item16);
            ComboBoxItem item17 = new ComboBoxItem {
                Content = "1 " + e.c("Days"),
                Tag = "1"
            };
            this.a3.Items.Add(item17);
            ComboBoxItem item18 = new ComboBoxItem {
                Content = "5 " + e.c("Days"),
                Tag = "5"
            };
            this.a3.Items.Add(item18);
            ComboBoxItem item19 = new ComboBoxItem {
                Content = "10 " + e.c("Days"),
                Tag = "10"
            };
            this.a3.Items.Add(item19);
            ComboBoxItem item20 = new ComboBoxItem {
                Content = e.c("Immediately"),
                Tag = "Immediately"
            };
            this.a3.Items.Add(item20);
        }

        [CompilerGenerated]
        private void c(object A_0)
        {
            this.d.Send(new SendOrPostCallback(this.b), null);
            NewsManager.c();
            this.d.Send(new SendOrPostCallback(this.a), null);
        }

        private void chkAutoConnection_Click(object A_0, RoutedEventArgs A_1)
        {
            this.a9.IsEnabled = !(A_0 as CheckBox).IsChecked.HasValue ? false : (A_0 as CheckBox).IsChecked.Value;
        }

        private void chkNotifyMe_Click(object A_0, RoutedEventArgs A_1)
        {
            if (this.au.IsChecked.Value || this.at.IsChecked.Value)
            {
                this.az.IsEnabled = true;
                this.a1.IsEnabled = true;
                this.a3.IsEnabled = true;
                this.ddlWithIn_SelectionChanged(this, null);
            }
            else
            {
                this.az.IsEnabled = false;
                this.a1.IsEnabled = false;
                this.a3.IsEnabled = false;
            }
            if (this.at.IsChecked.Value)
            {
                this.aw.IsEnabled = this.at.IsChecked.Value;
            }
            else
            {
                this.aw.IsEnabled = false;
            }
        }

        [CompilerGenerated]
        private void d(object A_0)
        {
            this.a();
        }

        private void ddlWithIn_SelectionChanged(object A_0, SelectionChangedEventArgs A_1)
        {
            if (this.au.IsChecked.Value || this.at.IsChecked.Value)
            {
                if ((this.az.SelectedItem as ComboBoxItem).Tag.ToString() == "Forever")
                {
                    foreach (ComboBoxItem item in (IEnumerable) this.a1.Items)
                    {
                        if (item.Tag.ToString() == "Never")
                        {
                            item.IsSelected = true;
                        }
                    }
                    this.a1.IsEnabled = false;
                }
                else
                {
                    this.a1.IsEnabled = true;
                }
            }
        }

        [CompilerGenerated]
        private void e(object A_0)
        {
            SendOrPostCallback d = null;
            SendOrPostCallback callback2 = null;
            SendOrPostCallback callback3 = null;
            string[] a = WebRequestManager.h();
            if (a != null)
            {
                <>c__DisplayClass1d classd;
                if (d == null)
                {
                    d = new SendOrPostCallback(classd.e);
                }
                this.d.Send(d, null);
                if (callback2 == null)
                {
                    callback2 = new SendOrPostCallback(classd.c);
                }
                this.d.Send(callback2, null);
                if (callback3 == null)
                {
                    callback3 = new SendOrPostCallback(classd.d);
                }
                this.d.Send(callback3, null);
            }
            this.d.Send(new SendOrPostCallback(this.d), null);
        }

        private void editEmail_click(object A_0, MouseButtonEventArgs A_1)
        {
            new IcqEmail(false).ShowDialog();
            this.b();
        }

        private void editIcq_Click(object A_0, MouseButtonEventArgs A_1)
        {
            new IcqEmail(true).ShowDialog();
            this.b();
        }

        private void EditPassword_Click(object A_0, MouseButtonEventArgs A_1)
        {
            new OptionsDialog().ShowDialog();
        }

        [DebuggerNonUserCode]
        public void InitializeComponent()
        {
            if (!this.bd)
            {
                this.bd = true;
                Uri resourceLocator = new Uri("/TheSafety;component/optionswindow.xaml", UriKind.Relative);
                Application.LoadComponent(this, resourceLocator);
            }
        }

        private void lblLicenseDifference_MouseLeftButtonUp(object A_0, MouseButtonEventArgs A_1)
        {
            Process.Start("http://thesafety.us/" + e.b() + "/gui_apps/");
        }

        private void lblShowNews_MouseLeftButtonUp(object A_0, MouseButtonEventArgs A_1)
        {
            ConfigManager.a(new NewsWindow());
        }

        private void lblUpdateNow_MouseLeftButtonUp(object A_0, MouseButtonEventArgs A_1)
        {
            new Thread(new ParameterizedThreadStart(this.c)) { IsBackground = true }.Start(null);
        }

        private void radioNotifier_Click(object A_0, RoutedEventArgs A_1)
        {
            if (this.ak.IsChecked.HasValue && this.ak.IsChecked.Value)
            {
                this.ap.IsEnabled = true;
                this.ar.IsEnabled = false;
            }
            else if (this.al.IsChecked.HasValue && this.al.IsChecked.Value)
            {
                this.ap.IsEnabled = false;
                this.ar.IsEnabled = true;
            }
            else if (this.am.IsChecked.HasValue && this.am.IsChecked.Value)
            {
                this.ap.IsEnabled = false;
                this.ar.IsEnabled = false;
            }
        }

        private void Window_Loaded(object A_0, RoutedEventArgs A_1)
        {
            string str7;
            this.d = SynchronizationContext.Current;
            this.b();
            this.aa.IsChecked = new bool?((ConfigManager.b("setauto") != null) && (ConfigManager.b("setauto") != "0"));
            this.z.IsChecked = new bool?((ConfigManager.b("p12") != null) && (ConfigManager.b("p12") != "0"));
            this.af.IsChecked = new bool?((ConfigManager.b("netblocker") != null) && (ConfigManager.b("netblocker") != "0"));
            this.an.IsChecked = new bool?((ConfigManager.b("updateifactive") != null) && (ConfigManager.b("updateifactive") != "0"));
            this.ar.Text = (ConfigManager.b("updatein") != null) ? ConfigManager.b("updatein") : "12:00";
            this.at.IsChecked = new bool?((ConfigManager.b("notifymeprolong") != null) && (ConfigManager.b("notifymeprolong") != "0"));
            this.au.IsChecked = new bool?((ConfigManager.b("notifymeimportant") != null) && (ConfigManager.b("notifymeimportant") != "0"));
            this.a8.IsChecked = new bool?((ConfigManager.b("autoconnection") != null) && (ConfigManager.b("autoconnection") != "0"));
            this.ba.IsChecked = new bool?((ConfigManager.b("dontshownotification") != null) && (ConfigManager.b("dontshownotification") != "0"));
            this.a7.IsChecked = new bool?(ConfigManager.c());
            this.aw.IsEnabled = this.at.IsChecked.Value;
            this.az.IsEnabled = this.au.IsChecked.Value;
            this.a1.IsEnabled = this.au.IsChecked.Value;
            this.a3.IsEnabled = this.au.IsChecked.Value;
            this.a9.IsEnabled = this.a8.IsChecked.Value;
            string str = (ConfigManager.b("notifydaysbefore") != null) ? ConfigManager.b("notifydaysbefore") : "3";
            foreach (ComboBoxItem item in (IEnumerable) this.aw.Items)
            {
                if (item.Content.ToString() == str)
                {
                    item.IsSelected = true;
                }
            }
            string str2 = (ConfigManager.b("updateeach") != null) ? ConfigManager.b("updateeach") : "720";
            foreach (ComboBoxItem item2 in (IEnumerable) this.ap.Items)
            {
                if (item2.Tag.ToString() == str2)
                {
                    item2.IsSelected = true;
                }
            }
            string str3 = (ConfigManager.b("notifydeletedays") != null) ? ConfigManager.b("notifydeletedays") : "5";
            foreach (ComboBoxItem item3 in (IEnumerable) this.a3.Items)
            {
                if (item3.Tag.ToString() == str3)
                {
                    item3.IsSelected = true;
                }
            }
            string str4 = (ConfigManager.b("notifyrepeateeach") != null) ? ConfigManager.b("notifyrepeateeach") : "5";
            foreach (ComboBoxItem item4 in (IEnumerable) this.a1.Items)
            {
                if (item4.Tag.ToString() == str4)
                {
                    item4.IsSelected = true;
                }
            }
            string str5 = (ConfigManager.b("notifywithin") != null) ? ConfigManager.b("notifywithin") : "5";
            foreach (ComboBoxItem item5 in (IEnumerable) this.az.Items)
            {
                if (item5.Tag.ToString() == str5)
                {
                    item5.IsSelected = true;
                }
            }
            string str6 = ConfigManager.b("autoconnectconfig");
            foreach (ComboBoxItem item6 in (IEnumerable) this.a9.Items)
            {
                if (item6.Tag.ToString() == str6)
                {
                    item6.IsSelected = true;
                }
            }
            if ((ConfigManager.b("schedulerupdate") != null) && ((str7 = ConfigManager.b("schedulerupdate")) != null))
            {
                if (!(str7 == "0"))
                {
                    if (str7 == "1")
                    {
                        this.al.IsChecked = true;
                        this.ap.IsEnabled = false;
                        this.ar.IsEnabled = true;
                    }
                    else if (str7 == "2")
                    {
                        this.am.IsChecked = true;
                        this.ap.IsEnabled = false;
                        this.ar.IsEnabled = false;
                    }
                }
                else
                {
                    this.ak.IsChecked = true;
                    this.ap.IsEnabled = true;
                    this.ar.IsEnabled = false;
                }
            }
            this.i.Text = AgentUser.a().d();
            this.k.Password = AgentUser.a().e();
        }
    }
}

